package com.bsoft.gol.hbs.bbpmessagel.enums;

/**
 * @author tongtp
 * @version v0.1
 * @Package com.bsoft.platform.model.enumcase
 * @className WhetherEnum
 * @description 是否枚举类
 * @create 2020-10-14 15:24
 **/
public enum WhetherEnum {

	//1是0否
	YES("1", "是"),
	NO( "0", "否");

	private final String key;
	private final String name;

	WhetherEnum(String key, String name) {
		this.key = key;
		this.name = name;
	}

	public static WhetherEnum getEnumByKey(String key) {
		for (WhetherEnum temp : WhetherEnum.values()) {
			if (temp.getKey().equals(key)) {
				return temp;
			}
		}
		return null;
	}

	public String getKey() {
		return key;
	}

	public String getName() {
		return name;
	}
}
